/*
    This file is part of the open source IVMP-MySQL project.

    IVMP-MySQL is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    IVMP-MySQL is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with IVMP-MySQL.  If not, see <http://www.gnu.org/licenses/>.
*/

/*
	File: HandleManager.h

	Description:
		Contains a class with static methods that allows the managing of numerous
		MySQL handles.
*/

#ifndef IVMP_MYSQL_HANDLEMANAGER_H
#define IVMP_MYSQL_HANDLEMANAGER_H

#include <MySQLHandle.h>
#include <map>

#define MAX_MYSQL_HANDLES 10

class HandleManager
{
public:
	static int AddHandle(MySQLHandle* handle);
	static MySQLHandle* GetHandle(unsigned int id);
	static void RemoveHandle(unsigned int id);
	static unsigned int Count();

private:
	static std::map<unsigned int, MySQLHandle*> Handles;
};

#endif